Daniel Boles [Sun, 8 Apr 2018 15:07:35 +0000 (16:07 +0100)]
testmodelbutton: Add explanatory comments to CSS
and load at an earlier, more sensible place, before creating any widgets
Daniel Boles [Sun, 8 Apr 2018 11:43:07 +0000 (12:43 +0100)]
ModelButton: Protect against nonsensical gbooleans
the same way we do normally.
Daniel Boles [Sun, 8 Apr 2018 12:07:38 +0000 (13:07 +0100)]
tests/testmodelbutton: Add this
and test whether :action-name, :role, and CSS nodes work as expected
https://gitlab.gnome.org/GNOME/gtk/issues/163
Timm Bäder [Sun, 8 Apr 2018 07:30:24 +0000 (07:30 +0000)]
Merge branch 'wip/sadiq/fixes' into 'master'
listbox: Fix signal name is documentation
See merge request GNOME/gtk!106
Mohammed Sadiq [Sun, 8 Apr 2018 05:07:31 +0000 (10:37 +0530)]
listbox: Fix signal name in documentation
Rico Tzschichholz [Fri, 6 Apr 2018 14:20:48 +0000 (16:20 +0200)]
Fix some g-i annotation warnings
Timm Bäder [Thu, 5 Apr 2018 18:47:25 +0000 (20:47 +0200)]
menu: Avoid an invalid read
Timm Bäder [Sat, 31 Mar 2018 15:30:03 +0000 (17:30 +0200)]
lockbutton: Remove priv pointer
Timm Bäder [Sat, 31 Mar 2018 12:54:14 +0000 (14:54 +0200)]
widgetbowl: Add switch demo
Benjamin Otte [Thu, 5 Apr 2018 22:42:17 +0000 (00:42 +0200)]
gtk-demo: Redo viewing of resources
1. Don't rely on GtkImage as a detector of file type anymore.
Instead, hardcode all extensions that are in use.
2. Add a display method for videos.
Benjamin Otte [Thu, 5 Apr 2018 22:41:44 +0000 (00:41 +0200)]
video: Add autoplay and loop boolean properties
Piotr Drąg [Thu, 5 Apr 2018 20:54:03 +0000 (22:54 +0200)]
Update POTFILES.in
Carlos Garnacho [Fri, 23 Mar 2018 17:24:58 +0000 (18:24 +0100)]
gtkmenushell: Port to using GtkEventControllerKey
Carlos Garnacho [Fri, 23 Mar 2018 15:46:40 +0000 (16:46 +0100)]
gtkcellrendereraccel: Port to using GtkEventControllerKey
Carlos Garnacho [Fri, 23 Mar 2018 15:22:05 +0000 (16:22 +0100)]
gtkentry: Use key controller to track focus changes
Carlos Garnacho [Fri, 23 Mar 2018 15:09:37 +0000 (16:09 +0100)]
gtkcalendar: Use key controller to track focus changes
Carlos Garnacho [Fri, 23 Mar 2018 15:02:44 +0000 (16:02 +0100)]
gtktextview: Use key controller for focus changes
Carlos Garnacho [Thu, 22 Mar 2018 17:32:19 +0000 (18:32 +0100)]
gtkeventcontrollerkey: Add ::focus-in/out signals
And handle GDK_FOCUS_CHANGE events in order to emit those.
Carlos Garnacho [Thu, 22 Mar 2018 16:54:52 +0000 (17:54 +0100)]
gtkeventcontrollerkey: Add get_group() call
Callers can use this function on a key-pressed/released signal
to find out the key event group, useful in a few places.
Carlos Garnacho [Sun, 11 Mar 2018 12:56:32 +0000 (13:56 +0100)]
gtkmenu: Stop using ::key-press-event
Use GtkEventControllerKey for the task
Carlos Garnacho [Sun, 11 Mar 2018 12:56:21 +0000 (13:56 +0100)]
gtkiconview: Stop using ::key-press-event
Use GtkEventControllerKey for the task
Carlos Garnacho [Sun, 11 Mar 2018 12:56:02 +0000 (13:56 +0100)]
gtkcellrendererspin: Stop using ::key-press-event
Use GtkEventControllerKey for the task
Carlos Garnacho [Sun, 11 Mar 2018 12:55:45 +0000 (13:55 +0100)]
appchoooserdialog: use search bar key capture API
Carlos Garnacho [Sun, 11 Mar 2018 12:54:54 +0000 (13:54 +0100)]
inspector: Use search bar API to capture key events from the toplevel
Carlos Garnacho [Sun, 11 Mar 2018 12:53:17 +0000 (13:53 +0100)]
gtksearchbar/entry: Add [gs]et_key_capture_widget() API calls
This lets these widgets actively pull events from a widget, instead
of passively being fed events.
Carlos Garnacho [Sun, 11 Mar 2018 12:47:11 +0000 (13:47 +0100)]
gtkwindow: Perform key activation in gtk_main_do_event()
In a similar spirit to the previous commit, make window shortcut
activation happen by default on toplevels, without relying on
legacy controllers.
Carlos Garnacho [Sun, 11 Mar 2018 12:44:37 +0000 (13:44 +0100)]
gtkwidget: Activate key bindings through run_controllers()
Deferring a bit further making those a standalone controller, make
binding activation happen on run_controllers(), so it happens by
default on widgets (unless the key event was consumed earlier)
without the need of a legacy event controller.
Carlos Garnacho [Sun, 11 Mar 2018 12:41:10 +0000 (13:41 +0100)]
gtkwidget: Break early if non-gesture controllers handle the event
Non gesture controllers have no means to collaborate with other
controllers, thus should be considered standalone entities. It makes
no sense to propagate any further if scroll/key controllers handled
the event.
Carlos Garnacho [Sun, 11 Mar 2018 12:38:19 +0000 (13:38 +0100)]
eventcontrollerkey: Add function to forward stuff elsewhere
Carlos Garnacho [Wed, 7 Mar 2018 16:59:22 +0000 (17:59 +0100)]
gtkmain: Don't use special paths for key event propagation
Set the event_widget to the window focus, and let event capture/bubble
handling do the rest.
Carlos Garnacho [Wed, 7 Mar 2018 16:58:32 +0000 (17:58 +0100)]
gtkrange: Stop using ::key-press-event
Use GtkEventControllerKey for the task
Carlos Garnacho [Wed, 7 Mar 2018 13:27:27 +0000 (14:27 +0100)]
gtkcellrendereraccel: simplify grabbing code
Matthias Clasen [Thu, 8 Feb 2018 00:36:48 +0000 (19:36 -0500)]
combo box: Stop using ::key-press-event
Switch to using ::event.
Matthias Clasen [Wed, 7 Feb 2018 21:31:59 +0000 (16:31 -0500)]
app chooser: Stop using ::key-press-event
For now, just switch to using ::event.
Carlos Garnacho [Tue, 6 Mar 2018 16:53:53 +0000 (17:53 +0100)]
gtkentrycompletion: Stop using ::key-press-event
Use GtkEventControllerKey for the task
Carlos Garnacho [Mon, 5 Mar 2018 17:50:35 +0000 (18:50 +0100)]
gtkplacessidebar: Stop using ::key-press-event
Use GtkEventControllerKey for the task
Carlos Garnacho [Mon, 5 Mar 2018 14:00:16 +0000 (15:00 +0100)]
gtktextview: Stop using ::key-press-event
Use GtkEventControllerKey for the task
Carlos Garnacho [Mon, 5 Mar 2018 14:00:06 +0000 (15:00 +0100)]
gtkflowbox: Stop using ::key-press-event
Use GtkEventControllerKey for the task
Carlos Garnacho [Mon, 5 Mar 2018 13:59:33 +0000 (14:59 +0100)]
gtkentry: Stop using ::key-press-event
Use GtkEventControllerKey for the task
Carlos Garnacho [Mon, 5 Mar 2018 13:59:21 +0000 (14:59 +0100)]
gtkcolorswatch: Stop using ::key-press-event
Use GtkEventControllerKey for the task
Carlos Garnacho [Mon, 5 Mar 2018 13:59:07 +0000 (14:59 +0100)]
gtkcolorplane: Stop using ::key-press-event
Use GtkEventControllerKey for the task
Carlos Garnacho [Mon, 5 Mar 2018 13:58:57 +0000 (14:58 +0100)]
gtkcalendar: Stop using ::key-press-event
Use GtkEventControllerKey for the task
Matthias Clasen [Thu, 8 Feb 2018 00:54:11 +0000 (19:54 -0500)]
search bar: Stop using ::key-press-event
Use a key event controller instead.
Matthias Clasen [Thu, 8 Feb 2018 00:42:47 +0000 (19:42 -0500)]
Shortcuts window: stop using ::key-press-event
Use a key event controller instead.
Matthias Clasen [Thu, 8 Feb 2018 00:27:16 +0000 (19:27 -0500)]
color editor: Stop using ::key-press-event
Use key event controllers instead.
Matthias Clasen [Thu, 8 Feb 2018 00:17:11 +0000 (19:17 -0500)]
about dialog: Stop using ::key-press-event
Use a key event controller instead.
Matthias Clasen [Sun, 4 Feb 2018 21:21:37 +0000 (22:21 +0100)]
icon-browser: Stop using ::key-press-event
Matthias Clasen [Sun, 4 Feb 2018 20:21:39 +0000 (21:21 +0100)]
places view: Stop using ::key-press-event
Matthias Clasen [Sun, 4 Feb 2018 08:29:44 +0000 (09:29 +0100)]
inspector: Stop using ::key-press-event
Matthias Clasen [Sat, 3 Feb 2018 12:01:47 +0000 (13:01 +0100)]
testgtk: Drop snapshot
This needs to be redone with modern snapshotting infrastructure.
Lets drop it for now, it is somewhat duplicative with inspector
features.
Matthias Clasen [Sat, 3 Feb 2018 11:58:23 +0000 (12:58 +0100)]
testgtk: Drop the event watcher
This is not a very useful test, and it is hard to keep working
in an event controller world.
Matthias Clasen [Sat, 3 Feb 2018 10:41:33 +0000 (11:41 +0100)]
docs: Modernize an example
The signals that are showcased here are going away.
Matthias Clasen [Wed, 31 Jan 2018 11:42:43 +0000 (12:42 +0100)]
gtk-demo: Stop using ::key-press-event in font explorer
Use a key controller instead. Note that this currently
breaks the handling of Enter, since we activate key bindings
twice, causing us to switch to the label and back.
Matthias Clasen [Wed, 31 Jan 2018 11:35:05 +0000 (12:35 +0100)]
testsuite: Don't use ::key-press-event
We don't need it here.
Matthias Clasen [Thu, 25 Jan 2018 07:27:43 +0000 (08:27 +0100)]
file chooser: Use a key event controller
We want to get rid of ::key-press-event.
Carlos Garnacho [Fri, 2 Feb 2018 15:04:17 +0000 (16:04 +0100)]
demos: Add "Paint" demo
Carlos Garnacho [Thu, 1 Feb 2018 16:52:40 +0000 (17:52 +0100)]
gtk: Add GtkGestureStylus
This is a GtkGesture done to deal with stylus events from drawing tablets.
Those have a special number of characteristics that extend a regular
pointer, so it makes sense to wrap that.
Carlos Garnacho [Mon, 29 Jan 2018 11:31:53 +0000 (12:31 +0100)]
gtkwindow: Unset focus grab_widget if it ends up unmapped
This may result on the later emission of crossing events, with one of the
sides being already unmapped/unrealized. The widget being unmapped will
result on repick and emission of a set of crossing events anyway.
Carlos Garnacho [Mon, 11 Dec 2017 18:21:38 +0000 (19:21 +0100)]
gtk: Add GtkEventControllerKey
This event controller is meant to replace usage from key-press/release-event
handlers all through. Optionally it can be set a GtkIMContext, so interaction
is carried by the controller.
Benjamin Otte [Thu, 5 Apr 2018 16:18:55 +0000 (18:18 +0200)]
snapshot: Don't cause invalid reads
1. Pass clip rectangles to gtk_snapshot_push_state() that point into
the state array.
2. g_array_set_size(len+1) the state array
3. Make that function realloc() the state array.
4. The clip rectangle now points into invalid memory
5. Use the clip array
This patch fixes things by moving step 5 to before step 2.
Benjamin Otte [Thu, 5 Apr 2018 15:32:57 +0000 (17:32 +0200)]
rendernode: Add missing return
Don't to extra work when not needed.
Piotr Drąg [Thu, 5 Apr 2018 15:37:22 +0000 (17:37 +0200)]
Update POTFILES.in
Benjamin Otte [Thu, 5 Apr 2018 15:09:52 +0000 (17:09 +0200)]
widget: Fix variable names
Stop docs build from complaining
Benjamin Otte [Thu, 5 Apr 2018 15:05:21 +0000 (17:05 +0200)]
a11y: Fix headers
We were getting a gcc warning before.
Benjamin Otte [Thu, 5 Apr 2018 14:36:13 +0000 (14:36 +0000)]
Merge branch 'window-activate' into 'master'
a11y: restore window:activate/deactivate emission
Closes #127
See merge request GNOME/gtk!77
Samuel Thibault [Fri, 23 Mar 2018 17:33:58 +0000 (18:33 +0100)]
a11y: restore window:activate/deactivate emission
1b9aa1b708c2 ('a11y: drop the focus tracker') removed a bit too much. We
still have to emit window:activate/deactivate events. They are easy to
emit anyway.
Fixes #127
Benjamin Otte [Thu, 5 Apr 2018 10:58:46 +0000 (12:58 +0200)]
inspector: Add an fps overlay
Benjamin Otte [Wed, 4 Apr 2018 11:22:28 +0000 (13:22 +0200)]
inspector: Bring back debug updates
This time, they are implemented as an overlay, so they require a running
inspector and can't be enabled via env variable anymore.
Benjamin Otte [Wed, 4 Apr 2018 11:14:21 +0000 (13:14 +0200)]
widget: Remove draw signal
The only remaining user is the text handle, but the text handle doesn't
draw anything anyway currently, so whoever fixes it can make it use
snapshots.
Benjamin Otte [Wed, 4 Apr 2018 10:38:09 +0000 (12:38 +0200)]
inspector: Introduce so-called "overlays"
Overlays are drawings that get rendered on top of the inspected window.
The only overlay in existence so far is the highlight overlay, which is
used to highlight widgets and replaces the "draw" signal handler used
previously.
Benjamin Otte [Wed, 4 Apr 2018 10:01:17 +0000 (12:01 +0200)]
widget: Add gtk_widget_compute_bounds()
The first in a set of functions intended to query widget coordinates
from another widget's coordinate system.
Benjamin Otte [Tue, 3 Apr 2018 19:09:35 +0000 (21:09 +0200)]
inspector: Change semantics of inspector render node notify
Instead of just notifying the inspector of what is going to be rendered,
allow the inspector to modify it.
This way, the inspector can overlay information it deems relevant over
the render node while still having access to what the actual widget
(without the inspector) would paint.
Benjamin Otte [Tue, 3 Apr 2018 12:14:37 +0000 (14:14 +0200)]
image: Actually report a request mode
This makes height-for-width actually work for GtkImage.
I'm kinda ashamed I didn't notice it not working before.
Benjamin Otte [Tue, 3 Apr 2018 07:30:55 +0000 (09:30 +0200)]
treeview: Remove invalidation tracking code
Benjamin Otte [Mon, 2 Apr 2018 07:18:48 +0000 (09:18 +0200)]
testgtk: Remove draw signal usage
Benjamin Otte [Mon, 2 Apr 2018 06:34:08 +0000 (08:34 +0200)]
widget: Remove GtkWidget.draw vfunc
Widgets are exclusively snapshot now.
The draw signal still exists.
Benjamin Otte [Mon, 2 Apr 2018 06:28:34 +0000 (08:28 +0200)]
widget: Remove gtk_widget_draw()
If you want to draw a widget to cairo today, you create a widget
paintable, snapshot it to a render node and then draw the render node to
cairo.
And yes, this is that complicated on purpose. Don't draw widgets to
Cairo.
Benjamin Otte [Mon, 2 Apr 2018 06:25:04 +0000 (08:25 +0200)]
reftests: Port from gtk_widget_draw() to snapshots
Benjamin Otte [Mon, 2 Apr 2018 06:19:51 +0000 (08:19 +0200)]
testgtk: Take an actual snapshot of a widget
Don't just draw the widget, take the paintable of it instead!
Benjamin Otte [Mon, 2 Apr 2018 06:12:37 +0000 (08:12 +0200)]
testlist3: Set the actual row as drag icon
(Well, don't do anything actually, because dnd is broken, but
in theory...)
Benjamin Otte [Mon, 2 Apr 2018 06:04:39 +0000 (08:04 +0200)]
widgetpaintable: Implement get_current_image()
Now that snapshot and empty paintables exist, this is rather trivial.
Benjamin Otte [Mon, 2 Apr 2018 05:55:02 +0000 (07:55 +0200)]
paintable: Introduce gdk_paintable_new_empty()
Also, use it where appropriate.
Benjamin Otte [Mon, 2 Apr 2018 04:15:50 +0000 (06:15 +0200)]
snapshot: Allow passing the bounds of the created paintable
This allows being more specific about the size.
It's useful in particular when the resulting render nodes might be
too small for the size, not only when they are too large. For the
latter case, using a clip node would be enough.
It also requires adding a clip node when rendering the resulting
paintable, but that should be optimized out by GtkSnapshot when not
necessary.
Benjamin Otte [Sun, 1 Apr 2018 13:25:16 +0000 (15:25 +0200)]
widgetpaintable: Protect against too many signals
This is actually not just a mechnaism to protect against too many
signals, but it's also a method to getting those signals at the wrong
time.
For every size/content change, a widget needs to invalidate twice:
Once when it queues a resize/redraw (going valid => invalid) and once
when the new size/content is actually assigned (going invalid => valid).
However, one of those invalidations might be inconvenient for the
listener. GtkImage for example does not like receiving
invalidate-contents signals when new contents are assigned, but is fine
with them when the old ones go invalid. And it will not try to draw the
paintable in between anyway.
So by bypassing the 2nd emission if nothing was changed, we can make
GtkImage happy.
Benjamin Otte [Sat, 31 Mar 2018 19:59:41 +0000 (21:59 +0200)]
demos: Add an image demo for widget paintables
Benjamin Otte [Sat, 31 Mar 2018 19:02:28 +0000 (21:02 +0200)]
widget: Remove clip from size-allocate vfunc
As the clip is no longer needed, get rid of it.
Benjamin Otte [Sat, 31 Mar 2018 18:15:47 +0000 (20:15 +0200)]
widget: Don't keep track of clip anymore.
It's not used anywhere, so why would we need it?
Benjamin Otte [Sat, 31 Mar 2018 18:02:55 +0000 (20:02 +0200)]
broadway: Improve error message
This error message is printed into the journal if a GTK app can't
connect to eithre Wayland or X11. Make it at least mention who is not
capable of connecting to a server.
Unrelated, we might want to improve our error reporting when a GTK app
can't start, so that debugging issues with system startup / login get
easier to resolve.
Benjamin Otte [Sat, 31 Mar 2018 16:37:53 +0000 (18:37 +0200)]
widget: Don't clip widgets anymore when snapshotting
This is the first step in removing clips.
It's seperate to allow bisecting to this commit when analyzing
performance problems.
Benjamin Otte [Sat, 31 Mar 2018 15:52:47 +0000 (17:52 +0200)]
widget: Cache clip from creating render node
When the clip changes that is passed to a snapshot function, we need to
create eventual cached render nodes because they might not have drawn
their whole area before.
Fixes issues with redrawing when scrolling.
Benjamin Otte [Sat, 31 Mar 2018 15:22:48 +0000 (17:22 +0200)]
snapshot: Track clip as a rect only
Benjamin Otte [Sat, 31 Mar 2018 10:52:19 +0000 (12:52 +0200)]
diff: Allow aborting a diff
When the max cost for finding a path gets to high, the diff can now be
aborted.
Because render nodes have a fallback method (by just marking the whole
bounds of the nodes as different), we use this to improve performance
of diffs.
This brings fishbowl (which is basically a container node with N images
that change every frame) back to close to previous performance.
Benjamin Otte [Sat, 31 Mar 2018 09:05:31 +0000 (11:05 +0200)]
build: Switch order of subdirectories
After fixing this once already in
5970dac1679d the order was messed up
again in
d50708b0240.
Benjamin Otte [Sat, 31 Mar 2018 09:02:32 +0000 (11:02 +0200)]
diff: Introduce GskDiffSettings
We can put lots of settings there to allow tuning the diff algorithm
used.
Benjamin Otte [Sat, 31 Mar 2018 06:17:42 +0000 (08:17 +0200)]
vulkan: Always render clip extents
Now that we have the full render nodes available, there is not much
benefit in fine-grained control over multiple rectangles.
In particular, it's causing pain with complex regions.
There might be a benefit in clipping to the region's rectangles in cases
like widget-factory where the whole diff is made up of the 2 rectangles
of spinner and the pulsing progress bar, but it needs a good heuristic
for where this is useful.
Benjamin Otte [Fri, 30 Mar 2018 13:39:25 +0000 (15:39 +0200)]
snapshot: Remove clip argument from gtk_snapshot_new()
It's not used anymore. And anybody who wants to have a clip on a
newly created snapshot can achieve that using gtk_snapshot_push_clip().
Benjamin Otte [Wed, 28 Mar 2018 15:09:49 +0000 (17:09 +0200)]
gtk: Remove gtk_widget_queue_draw_region()
... and gtk_widget_queue_draw_area().
They don't doi anything anymore.
Benjamin Otte [Wed, 28 Mar 2018 14:42:26 +0000 (16:42 +0200)]
widget: Stop tracking invalidations
Instead of calling gdk_surface_invalidate_region(), just
gdk_surface_queue_expose() and rely on the renderer computing the diff
from the previous rendering.
Benjamin Otte [Wed, 28 Mar 2018 14:06:32 +0000 (16:06 +0200)]
gtk: Remove debug updates
With the soon-to-arrive automatic updates (aka computing invalid region
from render nodes), this will no longer be necessary.
Benjamin Otte [Wed, 28 Mar 2018 13:43:43 +0000 (15:43 +0200)]
renderer: Track the previous node
... and diff the previous node with the current one to determine the
clip region.
This doubles the work necessary to track clip regions, but the following
commits will clean that up.